package com.jubotech.business.web.controller.admin;

import com.jubotech.business.web.domain.SysConfig;
import com.jubotech.business.web.service.SysConfigService;
import com.jubotech.framework.common.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/admin/sysConfig")
public class SysConfigController {

    @Autowired
    private SysConfigService service;

    //getByConfig
    @GetMapping("/getByConfig")
    @ResponseBody
    public ResultInfo getByConfig(@RequestParam("config") String config) {
        return ResultInfo.success(service.getByConfig(config));
    }

    //insert
    @PostMapping("/insert")
    @ResponseBody
    public ResultInfo insert(SysConfig info) {
        return ResultInfo.success(service.insert(info));
    }

    //update
    @PostMapping("/update")
    @ResponseBody
    public ResultInfo update(SysConfig info) {
        return ResultInfo.success(service.update(info));
    }

    //deleted
    @PostMapping("/delete")
    @ResponseBody
    public ResultInfo delete(SysConfig info) {
        return ResultInfo.success(service.delete(info));
    }
}
